public class so{
	public static void main(String arg[]){
	int []x = new int[5];
	int a;
	for(a=5;a>0;a--)
	{
		x[a-1]=a;
	}
	sort(x,0);
	}
	public static void sort(int[] y,int c){
	int[]z = new int[5];
	int ww;
	if(c==4)
	{
		ww=0;
		while(ww<5)
		{
		System.out.print(y[ww]);
		ww++;
		}
		System.out.println();
	}
	if(c!=4)
	{
		for(ww=1;ww<=5;ww++){
		z[ww-1]=y[ww-1];
		}
		for(ww=c;ww<5;ww++){
		int f=z[ww];
		z[ww]=z[c];
		z[c]=f;
		sort(z,c+1);
		}


	}

	}
}
